﻿using System;
using System.Collections.Generic;
using System.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace System.Architecture
{
    [Flags]
    public enum ViewState : byte
    {
        // Summary:
        //     The current app's view is in full-screen (has no snapped app adjacent to
        //     it), and has changed to landscape orientation.
        FullScreenLandscape = 1,
        //
        // Summary:
        //     The current app's view has been reduced to a partial screen view as the result
        //     of another app snapping.
        Filled = 2,
        //
        // Summary:
        //     The current app's view has been snapped.
        Snapped = 4,
        //
        // Summary:
        //     The current app's view is in full-screen (has no snapped app adjacent to
        //     it), and has changed to portrait orientation.
        FullScreenPortrait = 8,

        AllStates = Byte.MaxValue
    }

    public interface IView
    {
        /// <summary>
        /// Gets or sets the data context of the view.
        /// </summary>
        object DataContext { get; set; }
    }

    public interface IPageView : IView, ITitleSupport
    {
    }


    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class ExportViewAttribute : ExportAttribute//, IViewMetadata
    {
        public ExportViewAttribute()
        {            
        }

        public ExportViewAttribute(
            string Url,
            string Token,
            string[] DefaultRegions,
            ViewState SupportedViewStates = ViewState.AllStates
            )
            : base(typeof(IView))
        {
            CorrelationToken = Token;
            this.Url = Url;
            this.DefaultRegions = DefaultRegions;
            this.SupportedViewStates = SupportedViewStates;
        }

        public ViewState SupportedViewStates { get; set; }
        public string Url { get; set; }
        public string CorrelationToken { get; set; }
        public string[] DefaultRegions { get; set; }
    }
}
